/**
 * 
 */
$(document).ready(function() {
			
	
			//interest info
			$("#pop_upInterests").hide();
			$("#btn_AddSport").click(function(){
										$("#inside").css({
											"background-color":"gray"
										});
										
										$("#inside").fadeTo('slow', 0.5);
										$("#pop_upInterests").dialog({
												close: function(event, ui){
														$("#inside").css({
															"background-color":"white"
														});
														$("#inside").fadeTo('slow', 1);				
														$("#pop_upInterests").hide();
														return;						
												}}
										);								
																		
										return;
							   });
			$("#btn_SportSave").click(function(){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upInterests").dialog("close");						
										return;
	   			});
			$("#btn_AddCancelSport").click(function(){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upInterests").dialog("close");						
										return;
				});
			
			//MedicalInfo Threatments
			
			$("#pop_upMedicalThreatment").hide();
			$("#btn_AddThreatment").click(function(){
										$("#inside").css({
											"background-color":"gray"
										});
										
										$("#inside").fadeTo('slow', 0.5);
										$("#pop_upMedicalThreatment").dialog({
												close: function(event, ui){
														$("#inside").css({
															"background-color":"white"
														});
														$("#inside").fadeTo('slow', 1);				
														$("#pop_upMedicalThreatment").hide();
														return;						
												}}
										);								
																		
										return;										
							   			});
			$("#btn_ThreatmentSave").click(function(){
								$("#inside").css({
									"background-color":"white"
								});
								
								$("#inside").fadeTo('slow', 1);								
								$("#pop_upMedicalThreatment").dialog("close");									
								return;
	   				});
			$("#btn_AddCancelThreatment").click(function(){
								$("#inside").css({
									"background-color":"white"
								});
								$("#inside").fadeTo('slow', 1);				
								$("#pop_upMedicalThreatment").dialog("close");						
								return;
					});
			
			// Medical Conditions
			$("#pop_upMedicalCondition").hide();
			$("#btn_AddCondition").click(function(){
										$("#inside").css({
											"background-color":"gray"
										});
										$("#inside").fadeTo('slow', 0.5);
										
										$("#pop_upMedicalCondition").dialog({
											close: function(event, ui){
													$("#inside").css({
														"background-color":"white"
													});
													$("#inside").fadeTo('slow', 1);				
													$("#pop_upMedicalCondition").hide();
													return;						
											}}
										);
										return;
					});
			$("#btn_CondtionSave").click(function(){
								$("#inside").css({
									"background-color":"white"
								});
								
								$("#inside").fadeTo('slow', 1);								
								$("#pop_upMedicalCondition").dialog("close");								
								return;
	   				});
			$("#btn_AddCancelThreatment").click(function(){
								$("#inside").css({
									"background-color":"white"
								});
								$("#inside").fadeTo('slow', 1);				
								$("#pop_upMedicalCondition").dialog("close");						
								return;
					});
			
			//DatePickers			
			$("#txt_ThreatmentDateFrom").datepicker();
			//$("#txt_ThreatmentDateFrom").datepicker("option", "dateFormat", "yy-mm-dd");
			$("#txt_ThreatmentDateTo").datepicker();
			//$("#txt_ThreatmentDateTo").datepicker("option", "dateFormat", "yy-mm-dd");
			$("#txt_CondtitionDate").datepicker();
			$("#txt_Birthday").datepicker();
			
			//$("#tbl_Statuses").tablesorter(); 
			//$("table").tablesorter();
			
			/*$('table td').click(function(){					
			    $(this).parent().remove();
			});*/
			
			
			//Delete Condition
			$("#pop_upDeleteCondition").hide();
			$("img.deleteCondition").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteCondition").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteCondition").hide();
										return;						
								}}
						);
						
						$("#hdn_ConditionCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelCondition").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteCondition").dialog("close");						
						return;
			});
			$("#btn_DeleteCondition").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteCondition").dialog("close");							
				return;
			});
			
			
			//Delete Threatment
			$("#pop_upDeleteThreatment").hide();
			$("img.deleteThreatment").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteThreatment").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteThreatment").hide();
										return;						
								}}
						);
						
						$("#hdn_ThreatmentCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelThreatment").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteThreatment").dialog("close");						
						return;
			});
			$("#btn_DeleteThreatment").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteThreatment").dialog("close");							
				return;
			});
			
			
			//delete Sport popUP
			$("#pop_upDeleteSport").hide();
			$("img.deleteSport").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteSport").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteSport").hide();
										return;						
								}}
						);
						
						$("#hdn_SportCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelSport").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteSport").dialog("close");						
						return;
			});
			$("#btn_DeleteSport").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteSport").dialog("close");						
						return;
			});
			// Status form Slider
			$("#status_slider").slider({				
				range: "min",
				value: 1,				
				min: 1,
				max: 3,
				slide: function( event, ui ) {
					$("#hdn_StatusValue").val( ui.value );
				}
			});
			
			// Delete status profile controler
			$("#pop_upDeleteStatus").hide();
			$("img.deleteStatus").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteStatus").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteStatus").hide();
										return;						
								}}
						);
						
						$("#hdn_StatusCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelStatus").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteStatus").dialog("close");						
						return;
			});
			$("#btn_DeleteStatus").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteStatus").dialog("close");							
				return;
			});
			
			//Delete Outbox Message
			$("#pop_upDeleteSentMsg").hide();
			$("img.deleteSentMsg").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteSentMsg").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteSentMsg").hide();
										return;						
								}}
						);
						
						$("#hdn_SentMsgCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelSentMsg").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteSentMsg").dialog("close");						
						return;
			});
			
			$("#btn_DeleteSentMsg").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteSentMsg").dialog("close");							
				return;
			});
			
			
			//Delete Inbox Message
			$("#pop_upDeleteInboxMsg").hide();
			$("img.deleteInboxMsg").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteInboxMsg").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteInboxMsg").hide();
										return;						
								}}
						);
						
						$("#hdn_InboxMsgCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelInboxMsg").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteInboxMsg").dialog("close");						
						return;
			});
			
			$("#btn_DeleteInboxMsg").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteInboxMsg").dialog("close");							
				return;
			});

			//Delete Thread
			$("#pop_upDeleteThread").hide();
			$("img.deleteThread").click(function(){
				
						$("#inside").css({
							"background-color":"gray"
						});
						
						$("#inside").fadeTo('slow', 0.5);
						$("#pop_upDeleteThread").dialog({
								close: function(event, ui){
										$("#inside").css({
											"background-color":"white"
										});
										$("#inside").fadeTo('slow', 1);				
										$("#pop_upDeleteThread").hide();
										return;						
								}}
						);
						
						$("#hdn_ThreadCurrentDelete").val(this.alt);
						
						return;
			});
			
			$("#btn_DeleteCancelThread").click(function(){
						$("#inside").css({
							"background-color":"white"
						});
						$("#inside").fadeTo('slow', 1);				
						$("#pop_upDeleteThread").dialog("close");						
						return;
			});
			
			$("#btn_DeleteThread").click(function(){
				$("#inside").css({
					"background-color":"white"
				});
				$("#inside").fadeTo('slow', 1);				
				$("#pop_upDeleteThread").dialog("close");							
				return;
			});
			
		//Search del
			$("#Search_panel").accordion({ 
				collapsible: true,
				active: false
				});
		//tab groups
			$("#viewGroup_tab").tabs();
				
}); 